package com.tinshow.service.user.impl;

import com.tinshow.dao.user.UserMapper;
import com.tinshow.model.user.User;
import com.tinshow.service.user.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by libo4 on 2017-05-07.
 */
@Service
public class UserServiceImpl implements UserService{

    @Autowired
    UserMapper userMapper;

    @Override
    public Integer insertUser(User user) {
        return userMapper.insertSelective(user);
    }

    @Override
    public User selectUser(User user) {
        return userMapper.selectByEmail(user);
    }

    @Override
    public User selectUserById(Integer userId) {
        return userMapper.selectByPrimaryKey(userId);
    }

    @Override
    public Integer updateUser(User user) {
        return userMapper.updateByPrimaryKeySelective(user);
    }
}
